/*----------------------------------------------------------------------------*\
| /gamemode/cl_notices.lua             | notices system                  | CLI |
\*----------------------------------------------------------------------------*/

local function RecvPlayerKilledByPlayer( um ) 
	local victim 	= um:ReadEntity()
	local inflictor	= um:ReadString()
	local attacker 	= um:ReadEntity()

	//local text = victim:Name() .. " was betrayed by " .. attacker:Name()
	local text = "..."..victim:Name() .. " died."

	SendLocalMessage( 0, nil, text, "kill", CHAT_COL_KILL )
end 
usermessage.Hook( "PlayerKilledByPlayer", RecvPlayerKilledByPlayer ) 

local function RecvPlayerKilledSelf( um ) 
	local victim 	= um:ReadEntity()
				
	//local text = victim:Name() .. " killed himself."
	local text = "..."..victim:Name() .. " died."

	SendLocalMessage( 0, nil, text, "kill", CHAT_COL_KILL )
end 
usermessage.Hook( "PlayerKilledSelf", RecvPlayerKilledSelf ) 

local function RecvPlayerKilled( um ) 
	local victim 	= um:ReadEntity() 
	local inflictor	= um:ReadString()
	local attacker 	= um:ReadString()

	//local text = victim:Name() .. " was killed by " .. attacker
	local text = "..."..victim:Name() .. " died."

	SendLocalMessage( 0, nil, text, "kill", CHAT_COL_KILL )
end 
usermessage.Hook( "PlayerKilled", RecvPlayerKilled ) 

local function RecvPlayerKilledNPC( um ) 
	local victim 	= "#" .. um:ReadString() 
	local inflictor	= um:ReadString() 
	local attacker 	= um:ReadEntity()
	
	if string.find( victim, "zed" ) or string.find( victim, "zombie" ) then
		local wep = attacker:GetActiveWeapon()
		local text = attacker:Name() .. " " .. wep.KillString1 .. " a zombie " .. wep.KillString2 .. "."
		SendLocalMessage( 0, nil, text, "kill", CHAT_COL_KILL )
	end
end 
usermessage.Hook( "PlayerKilledNPC", RecvPlayerKilledNPC ) 